import request from '@/utils/request'

 //获取用户权限数据
export async function  getCustomers() {
    let res =  await request({
      url: '/Customers',
      method: 'get',
    })
    return res.data.value;
  }
 //增加用户权限数据
export function addCustomer (data) {
  return   request({
        url: '/Customers',
        method: 'POST',
        data
    })
   
}

 //删除用户权限数据
 export function removeCustomer(id){
    return request({
      url: `/Customers/${id}`,
      method: 'delete'
    })
    // return  new Promise( async (resolve, reject) => {
    //   var index = datas.findIndex(e=>e.id==id);
    //   datas.splice(index,1);
    //   resolve();
    // });
  }
  export function updateCustomer(parking){
    return  request({  
      url: `/Customers(${parking.CustformId})`,
      method: 'put',
      data: parking
    })
  }

  export async function  getSystems() {
    let res =  await request({
      url: '/Systems',
      method: 'get',
    })
    return res.data.value;
  }